/*
* $Id: ViewJournal.cpp 161 2010-10-03 23:45:28Z volok-aleksej@yandex.ru $
*
* Copyright 2009 by Volokitin Alexey
* All rights reserved
*
*/
#include "Common/include.h"
#include "ViewJournal.h"
#include "JournalDefined.h"
#include "../CommandIds.h"

#pragma warning(disable: 4407)

CEmptyViewJournal::CEmptyViewJournal(CState* pState){
	m_pState = pState;
}

CEmptyViewJournal::~CEmptyViewJournal(){
	DestroyView();
}
void CEmptyViewJournal::SetState(){
	m_pState->m_nState = Journal::EMPTY_VIEW;
	m_pState->m_nIdParameter = 0;
}

void CEmptyViewJournal::CreateView(){
	if(IsCreate())
		return;
	CWnd* wnd = dynamic_cast<CWnd*>(IVisualManager::GetVisualManager()->
		GetVisualComponent(ILanguageManager::GetLanguageManager()->GetString(JOURNAL_CAPTION_ID))->GetComponentFrame());
	CRect rect;
	wnd->GetClientRect(rect);
	Create(AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW), _T(""), WS_CHILD|WS_VISIBLE,
			CRect(200, 24 + SIZE_TOOLBAR, rect.right, rect.bottom), wnd, VIEW_JOURNAL_WND_ID);
}
void CEmptyViewJournal::DestroyView(){
	if(IsCreate())
		DestroyWindow();
}
bool CEmptyViewJournal::IsViewState(State state){
	return true;
}

BEGIN_MESSAGE_MAP(CEmptyViewJournal, CWnd)
	ON_WM_PAINT()
END_MESSAGE_MAP()

void CEmptyViewJournal::OnPaint(){
	CPaintDC dc(this);
	CRect rect;
	GetClientRect(rect);
	CBrush brush;
	brush.CreateSolidBrush(GetSysColor(COLOR_3DFACE));
	dc.FillRect(rect, &brush);
	brush.DeleteObject();
}

void CEmptyViewJournal::Free(){
	delete this;
}

void CEmptyViewJournal::Init(){}
